Skip to content

Fix logged notification count #4323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rajagopalanand
Copy link
Contributor

A simple fix to correct the log message. In cases where context cancelation occurs, the logs show notification was attempted twice when in fact it was only attempted once

@rajagopalanand rajagopalanand marked this pull request as ready for review March 31, 2025 02:06
notify/notify.go Outdated
@@ -848,6 +848,7 @@ func (r RetryStage) exec(ctx context.Context, l *slog.Logger, alerts ...*types.A
default:
}

i++
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that if Line 844 is true, the error message contains 0 attempts, which is incorrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The very first attempt to send notification only happens on line 855. Even if 844 were true, and it contains 0 attempts, I think that is correct.

Correct me if I'm wrong

Signed-off-by: Anand Rajagopal <[email protected]>
@grobinson-grafana grobinson-grafana merged commit 6ecd006 into prometheus:main Apr 2, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants